package com.woniuxy.portal.controller;

import com.woniuxy.portal.common.Result;
import com.woniuxy.portal.entity.Booktype;
import com.woniuxy.portal.model.vo.BookTypeVo;
import com.woniuxy.portal.service.IBooktypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *  图书分类
 */
@RestController
@RequestMapping("/booktype")
public class BooktypeController {
    @Autowired
    private IBooktypeService booktypeService;

    /**
     * 图书分类，查询所有分类
     */
    @GetMapping
    public Result findAll(){
        List<BookTypeVo> list = booktypeService.findBookTypes();
        return Result.ok(list);
    }
}
